﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse
{
    using System.Diagnostics;
    using System.Windows;
    using Microsoft.Phone.Controls;
    using Microsoft.Phone.Shell;
    
    /// <summary>The main entry point of the application.</summary>
    public partial class App : Application
    {
        /// <summary>Initializes a new instance of the <see cref="App"/> class.</summary>
        public App()
        {
            // Global handler for uncaught exceptions. 
            this.UnhandledException += (sender, e) =>
                {
                    if (Debugger.IsAttached)
                    {
                        Debugger.Break();
                    }
                };

            // Standard Silverlight initialization
            this.InitializeComponent();

            this.RootVisual = new PhoneApplicationFrame();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                Application.Current.Host.Settings.EnableFrameRateCounter = true;
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
    }
}